tests: add load tests to the cache ingestion and simulation loop#236
tests: add load tests to the cache ingestion and simulation loop#236dylanlott wants to merge 2 commits intodylan/sim-testsfrom
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
7697e42 to
d99e2c8
Compare
|
The 50k test won't pass so this PR shouldn't be merged until the simulation deadlock issue is resolved. |
acec1af to
def269d
Compare
9ad68c9 to
0788c93
Compare
|
I thought the deadlock issue would solve the 50k test, but it still fails, but not sure what the root cause is yet. |
- every bundle had the same effective fee score, so cache insertion hit heavy rank collision
ba26c1a to
edbd58d
Compare
|
Update: It wasn't a deadlock, it was a very long running test from a runtime blow up. The blow up was caused by a priority fee collision at insertion time. After assigning different priority fees, tests pass. |
| /// 50k bundles each containing 1 transfer tx. Verify block builds with non-zero count of included txs. | ||
| #[tokio::test(flavor = "multi_thread", worker_threads = 4)] | ||
| async fn test_load_50k_bundles() { | ||
| let count = 50_000; |
There was a problem hiding this comment.
I wonder if it's worth dropping this to 5k, since it takes ~70 seconds to complete for me with 50k
| /// Many bundles with a tight deadline. Verify block completes within time. | ||
| #[tokio::test(flavor = "multi_thread", worker_threads = 4)] | ||
| async fn test_load_deadline_pressure() { | ||
| let count = 100; |
There was a problem hiding this comment.
For me, we manage to include all 100 txs within the 500ms deadline. Maybe we should bump this to 1000 and at the end of the test also do
assert!(built.tx_count() < count, "expected not all txs to be executed");| balance: info.balance, | ||
| has_code: info.code_hash != trevm::revm::primitives::KECCAK_EMPTY, | ||
| }), | ||
| _ => Ok(AcctInfo { nonce: 0, balance: U256::ZERO, has_code: false }), |
There was a problem hiding this comment.
Just to future-proof in case we change the error type:
| _ => Ok(AcctInfo { nonce: 0, balance: U256::ZERO, has_code: false }), | |
| Ok(None) => Ok(AcctInfo { nonce: 0, balance: U256::ZERO, has_code: false }), | |
| Err(_) => unreachable!("error type is infallible"), |
This seems worth looking into? |

tests: add load tests to the cache ingestion and simulation loop
Per discussions with @Fraser999 I load tested the builder simulation loop and was able to reproduce the same error they saw - the build function deadlocks over some limit of bundles, which also prevents the simulation deadline from being respected.
The screenshot shows the test running and taking over 60 seconds, but with the deadline configured for 12 seconds, which should terminate the build loop and return a block with
tx_count > 0.